# -*- coding:utf-8 -*-
import time
from selenium.webdriver.support.ui import WebDriverWait


class Doctor_login():
    def __init__(self, driver):
        self.driver = driver

    def InputAccount(self, number, password):
        time.sleep(2)
        self.driver.find_element_by_id('com.jkgj.skymonkey.doctor:id/et_phone').send_keys(number)
        self.driver.find_element_by_id('com.jkgj.skymonkey.doctor:id/et_psw').send_keys(password)
        self.driver.find_element_by_id('com.jkgj.skymonkey.doctor:id/tv_go_login').click()
        # WebDriverWait(self,30).until(lambda x: x.find_element_by_name('首页'))
        print '医生账户%s --登录成功' % number

    def SelectMenus(self, menuID):
        time.sleep(5)
        # if menuID == 1:
        #     self.menus = '首页'
        # elif menuID == 2:
        #     self.menus = '发现'
        # elif menuID == 3:
        #     self.menus = '个人中心'
        # else:
        #     print "首页选择错误"
        # if self.menus:
        WebDriverWait(self.driver, 10).until(lambda x: x.find_element_by_name(self.menus)).click()
        print '当前选择---%s ' % self.menus
